package com.yzs.base.base

import android.view.LayoutInflater
import androidx.viewbinding.ViewBinding

/**
 *    author : yzs
 *    date   : 2022/1/1311:59
 *    desc   : base 层提供便捷使用 viewBinding
 */
abstract class BaseVBActivity<VB : ViewBinding>(
    private val inflate: (LayoutInflater) -> VB
) : BaseActivity() {
    lateinit var binding: VB

    override fun initViewBinding(): ViewBinding? {
        binding = inflate(layoutInflater)
        return binding
    }

    // viewBinding 不需要 layoutId 所以子类不需要重写
    override fun getLayoutId() = 0

}